import dataProvider from '../../service/dataProvider'
const app = getApp()
Page({
  data: {
    shares: dataProvider.shares,
    share: {
      title: '逼疯外地人的30句重庆话，看到第一句重庆人都跪服了！',
      describle: '',
      image: ''
    },
    list: dataProvider.list.filter(item => item.categoryId == 1 || item.categoryId == 2)
  },
  onLoad: function () {
    console.log('onLoad')
    var that = this
  },
  onShareAppMessage: function () {
    let share = this.data.shares[Math.floor(Math.random() * this.data.shares.length)];
    return {
      title: share.title,
      // desc: '',
      path: '/pages/list/index',
      imageUrl: share.imageUrl
    }
  },
  showDetail: function (e) {
    // 跳转详情页
    var item = e.currentTarget.dataset.item;
    wx.navigateTo({
      url: "../detail/index?id=" + item.id
    });
  },
})

